import {mapGetters,mapState} from "vuex"
export default {
	computed: {
		...mapState("cartAbout",["cart"]),
		...mapGetters("cartAbout",["total"]),
	},
	watch: {
		cart: {
			deep: true,
			handler(newValue) {
				this.setBabde();
			}
		}
	},
	methods: {
		setBabde() {
			uni.setTabBarBadge({
				index: 2,
				text: this.total+""
			})
		}
	},
	onShow() {
		this.setBabde();
	}
}